#pragma once
#include <Rz/Config.h>
#include <Rz/Diagnostics/Assert.h>
#include <Rz/Collections/IEnumerable.h>

namespace Rz {

template <typename TDestType, typename TEnum, u32 elements>
struct EnumBasedContainer// :
// 	public Object,
// 	public Collections::IEnumerable<TDestType>
{
// 	RZ_RTTI(Rz, EnumBasedContainer);
// 	RZ_RTTI_IMPLEMENTS(Object/*, Collections::IEnumerable<TDestType>*/);
// 	RZ_RTTI_TEMPLATES(NonObjectType<TDestType>, NonObjectType<TEnum>, NonObjectType<u32>);
// 	RZ_RTTI_END;
                
// 	typedef typename Collections::IEnumerable<TDestType>::ConstIterator ConstIterator;
// 	typedef typename Collections::IEnumerable<TDestType>::Iterator Iterator;

	RZ_INLINE TDestType& operator [] (u32 index)
	{
		RZ_ASSERT(index >= 0 && index < elements);
		return _enum[index];
	}

	RZ_INLINE const TDestType& operator [] (u32 index) const
	{
		RZ_ASSERT(index >= 0 && index < elements);
		return _enum[index];
	}

	RZ_INLINE TDestType& operator [] (TEnum index)
	{
		RZ_ASSERT((u32)index >= 0 && (u32)index < elements);
		return _enum[(u32)index];
	}

	RZ_INLINE const TDestType operator [] (TEnum index) const
	{
		RZ_ASSERT((u32)index >= 0 && (u32)index < elements);
		return _enum[(u32)index];
	}
	/*
	virtual ConstIterator ConstBegin()	const	{ return ConstIterator(typename ConstIterator::Pointer(&_enum[0])); }
	virtual ConstIterator ConstEnd()	const	{ return ConstIterator(typename ConstIterator::Pointer(&_enum[elements])); }

	virtual Iterator Begin()	{ return Iterator(typename Iterator::Pointer(&_enum[0])); }
	virtual Iterator End()		{ return Iterator(typename Iterator::Pointer(&_enum[elements])); }
	*/
	private:
		TDestType _enum[elements];
};

}